// --------------------------------------------------------------------------------------------------------------------
// <copyright file="EngineNodesElementCollection.cs" company="dimamartovoi">
//   Apache License
//   Version 2.0, January 2004
//   http://www.apache.org/licenses
// </copyright>
// <summary>
//   The engine nodes element collection.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

using System.Configuration;

namespace ActorModel.Infrastructure.Configuration.XML
{
    /// <summary>
    ///     The engine nodes element collection.
    /// </summary>
    [ConfigurationCollection(typeof(EngineNodesElementCollection), AddItemName = "node")]
    public class EngineNodesElementCollection : ConfigurationElementCollection
    {
        #region Methods

        /// <summary>
        ///     The create new element.
        /// </summary>
        /// <returns>
        ///     The <see cref="ConfigurationElement" />.
        /// </returns>
        protected override ConfigurationElement CreateNewElement()
        {
            return new EngineNodeConfigurationElement();
        }

        /// <summary>
        /// The get element key.
        /// </summary>
        /// <param name="element">
        /// The element.
        /// </param>
        /// <returns>
        /// The <see cref="object"/>.
        /// </returns>
        protected override object GetElementKey(ConfigurationElement element)
        {
            return ((EngineNodeConfigurationElement)element).Id;
        }

        #endregion
    }
}